
import * as user from '@/api/user.js'


// 全部接口注册挂载 
let api = {
	user,
	objectToQuery(obj) {
		let keys = Object.keys(obj);
		return keys.reduce((query,attr,index) => {
			
			// 判断是否是第一层第一个循环
			if (index === 0) query += "?";
			
			query += `${attr}=${obj[attr]}`;
			
			// 判断是否是第一层最后一个循环
			if (index !== keys.length - 1) query += "&";
			
			return query;
			
		},"");
	},
}

export default api;